<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type="text/javascript" src="/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="/js/jquery-ui-1.8.21.custom.min.js"></script>
<script type="text/javascript" src="/js/jquery.leanModal.min.js"></script>
<script>
function transfer(date_begin,date_end){
	window.location.href = 'http://<?php echo WEB_IP?>/staff/team-bonus-wizard-confirm/date_begin/'+ date_begin + '/date_end/' + date_end + '/next/yes';
}

</script>
</head>

<body style="font-family:Arial, Helvetica, sans-serif; line-height:20px;">
<h1>
  <br />
  Team bonus staff List
  <br />
  <br />
  <?php echo $this->dateBegin."  to ".$this->dateEnd; ?>
<br />
</h1><form action="" method="post">
<?php $groupShops = unserialize(ARR_SHOP_GROUP);
	  $stDetail = new Model_DbTable_Roster_Stafflogindetail();
	  $orgBonus = $this->orgBonus;
	  $tBonus = unserialize(T_BONUS_MANAGER);?>
	  
<br/>
<table width="600" border="1" cellspacing="0" cellpadding="10">
<?php foreach ($this->stfBonus as $shopCode => $stfList){
		$i= 1;?>
<tr>
	<th colspan = "4"><?php echo $shopCode." ($".$orgBonus[$shopCode].")";?></th>
</tr>
<tr>
	<th scope ="col">No.</th>
	<th scope ="col">Name</th>
	<th scope ="col">Calculation</th>
	<th scope ="col">Bonus</th>
</tr>
	<?php foreach ($stfList as $stfId => $bonus){
				$stfD = $stDetail->getDetail($stfId);?>
	<tr>
		<td><?php echo $i++;?></td>
		<td><?php echo Model_EncryptHelper::getSslPassword($stfD["n"])." (".$stfD['ni'].") ";?></td>
		<td><?php echo $orgBonus[$shopCode]." x ".$tBonus[$shopCode][$stfId]."% ="?></td>
		<td><input type = "text" name = "staffBonus[<?php echo $shopCode?>][<?php echo $stfId?>]" value = "<?php echo $bonus?>"></input></td>
	</tr>
	<?php }?>
	<?php /*?>
	<tr>
		<td><?php echo $i++?></td>
		<td><?php echo 'UB Bonus'?></td>
		<td><?php echo $orgBonus[$shopCode]." x 20% ="?></td>
		<td><input type = "text" name = "uaBonus[<?php echo $shopCode?>]" value = "<?php echo round($orgBonus[$shopCode]*0.2,2)?>"></input></td>
	</tr>
	*/ ?>
<?php }?>
</table>
<br />
<input name="submit_bonus" type="submit" value = "Confirm"/>
</form>
<div id = "payrollWizard" <?php if(!$this->nextCheck){?>style = "visibility:hidden;<?php }?>">
<input type = "submit" name = "next" id = "next" value = "Next" style = "margin-left:530px;" onclick= "transfer('<?php echo $this->dateBegin;?>','<?php echo $this->dateEnd;?>')"></input>
</div>
</body>
</html>